<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>服务器对index.jsp的响应程序</title>
</head>
<body>
	<%
		// 使用request内置对象，获取客户端请求的表单数据
		// 设置编码
		request.setCharacterEncoding("utf-8");
		// 获取表单时
		String strName = request.getParameter("txtName");
		String strPsw = request.getParameter("txtPsw");
		// 进行数据库连接，进行数据操作
		System.out.print(strName + "-" + strPsw);
		
		// 使用request缓存当前的用户名
		request.setAttribute("userName", strName);
		request.getSession().setAttribute("userName2", strName);
		// 转发或重定向到结果页面
		//request.getRequestDispatcher("logined.jsp").forward(request, response);
		// 转发到结果页
		response.sendRedirect("logined.jsp");
	%>

</body>
</html>